package cn.qicaiwang.open.system.mapper;

import cn.qicaiwang.open.system.model.entity.SystemRole;
import cn.qicaiwang.open.system.model.req.SystemRoleREQ;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * SystemRoleMapper继承基类
 */
public interface SystemRoleMapper extends BaseMapper<SystemRole> {
    List<SystemRole> selectListByUserId(String id);

    Page<SystemRole> page(Page page, SystemRoleREQ params);

    @Select("select * from system_role where del_flag = 1")
    Page<SystemRole> recyclebin(Page page);
    @Update("update system_role set del_flag = 0 where id = #{id}")
    int restore(String id);

    @Delete("delete from system_role where del_flag = 1")
    int clear();
}